package com.srit.forecast.aop;

import java.lang.reflect.Method;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.srit.system.dao.EventDao;

@Component
public class ReportBeforeAdvice implements MethodBeforeAdvice {
	protected Logger logger = LoggerFactory.getLogger(ReportBeforeAdvice.class);
	private Map eventMap;

	@Autowired
	private EventDao eventDao;

	public ReportBeforeAdvice() {
		System.out.println(eventDao);
	}

	@Override
	public void before(Method method, Object[] args, Object target)
			throws Throwable {
		System.out.println(eventDao);
		logger.debug(method.getName());
		logger.debug("args length is {}", args.length);
		logger.debug("target's class is {}", target.getClass());
	}

}
